<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/GoG.Infrastructure.Engine" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/GoG.Infrastructure.Engine" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="GoResultCode">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Success" />
      <xs:enumeration value="CommunicationError" />
      <xs:enumeration value="ServerInternalError" />
      <xs:enumeration value="GameDoesNotExist" />
      <xs:enumeration value="GameAlreadyExists" />
      <xs:enumeration value="ClientOutOfSync" />
      <xs:enumeration value="SimultaneousRequests" />
      <xs:enumeration value="IllegalMoveSpaceOccupied" />
      <xs:enumeration value="IllegalMoveSuicide" />
      <xs:enumeration value="IllegalMoveSuperKo" />
      <xs:enumeration value="OtherIllegalMove" />
      <xs:enumeration value="OtherEngineError" />
      <xs:enumeration value="EngineBusy" />
      <xs:enumeration value="CannotScore" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="GoResultCode" nillable="true" type="tns:GoResultCode" />
  <xs:complexType name="GoGameState">
    <xs:sequence>
      <xs:element minOccurs="0" name="BlackPositions" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="GoMoveHistory" nillable="true" type="tns:ArrayOfGoMoveHistoryItem" />
      <xs:element minOccurs="0" name="Operation" type="tns:GoOperation" />
      <xs:element minOccurs="0" name="Player1" nillable="true" type="tns:GoPlayer" />
      <xs:element minOccurs="0" name="Player2" nillable="true" type="tns:GoPlayer" />
      <xs:element minOccurs="0" name="Size" type="xs:unsignedByte" />
      <xs:element minOccurs="0" name="Status" type="tns:GoGameStatus" />
      <xs:element minOccurs="0" name="WhitePositions" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="WhoseTurn" type="tns:GoColor" />
      <xs:element minOccurs="0" name="WinMargin" type="xs:decimal" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="GoGameState" nillable="true" type="tns:GoGameState" />
  <xs:complexType name="ArrayOfGoMoveHistoryItem">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="GoMoveHistoryItem" nillable="true" type="tns:GoMoveHistoryItem" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ArrayOfGoMoveHistoryItem" nillable="true" type="tns:ArrayOfGoMoveHistoryItem" />
  <xs:complexType name="GoMoveHistoryItem">
    <xs:sequence>
      <xs:element minOccurs="0" name="Move" nillable="true" type="tns:GoMove" />
      <xs:element minOccurs="0" name="Result" nillable="true" type="tns:GoMoveResult" />
      <xs:element minOccurs="0" name="Sequence" type="xs:int" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="GoMoveHistoryItem" nillable="true" type="tns:GoMoveHistoryItem" />
  <xs:complexType name="GoMove">
    <xs:sequence>
      <xs:element minOccurs="0" name="Color" type="tns:GoColor" />
      <xs:element minOccurs="0" name="MoveType" type="tns:MoveType" />
      <xs:element minOccurs="0" name="Position" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="GoMove" nillable="true" type="tns:GoMove" />
  <xs:simpleType name="GoColor">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Black" />
      <xs:enumeration value="White" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="GoColor" nillable="true" type="tns:GoColor" />
  <xs:simpleType name="MoveType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Normal" />
      <xs:enumeration value="Pass" />
      <xs:enumeration value="Resign" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="MoveType" nillable="true" type="tns:MoveType" />
  <xs:complexType name="GoMoveResult">
    <xs:sequence>
      <xs:element minOccurs="0" name="CapturedStones" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Status" type="tns:GoGameStatus" />
      <xs:element minOccurs="0" name="WinMargin" type="xs:decimal" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="GoMoveResult" nillable="true" type="tns:GoMoveResult" />
  <xs:simpleType name="GoGameStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Active" />
      <xs:enumeration value="BlackWon" />
      <xs:enumeration value="WhiteWon" />
      <xs:enumeration value="BlackWonDueToResignation" />
      <xs:enumeration value="WhiteWonDueToResignation" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="GoGameStatus" nillable="true" type="tns:GoGameStatus" />
  <xs:simpleType name="GoOperation">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Idle" />
      <xs:enumeration value="Starting" />
      <xs:enumeration value="NormalMove" />
      <xs:enumeration value="Pass" />
      <xs:enumeration value="Resign" />
      <xs:enumeration value="GenMove" />
      <xs:enumeration value="Hint" />
      <xs:enumeration value="Undo" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="GoOperation" nillable="true" type="tns:GoOperation" />
  <xs:complexType name="GoPlayer">
    <xs:sequence>
      <xs:element minOccurs="0" name="Level" type="xs:int" />
      <xs:element minOccurs="0" name="Name" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="PlayerType" type="tns:PlayerType" />
      <xs:element minOccurs="0" name="Score" type="xs:decimal" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="GoPlayer" nillable="true" type="tns:GoPlayer" />
  <xs:simpleType name="PlayerType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Human" />
      <xs:enumeration value="AI" />
      <xs:enumeration value="Remote" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="PlayerType" nillable="true" type="tns:PlayerType" />
</xs:schema>